package remote.controls
{
	import flash.display.CapsStyle;
	
	/**
	 * 水平分隔线
	 * @author 银魂飞雪
	 * @createDate 2011-4-3
	 */
	public class HRule extends Rule
	{
		public function HRule()
		{
			super();
		}
		
		override public function updateSkin():void
		{
			
		}
		
		override public function setInfo(colors:Array, alphas:Array, thickness:Array):void
		{
			super.setInfo(colors, alphas, thickness);
			var totalHeight:Number = 0;
			for each(var num:Number in thickness)
			{
				totalHeight += num;
			}
			height = totalHeight;
		}
		
		override protected function draw():void
		{
			var drawedHeight:Number = 0;
			graphics.clear();
			for(var i:int = 0; i < colors.length; i++)
			{
				drawedHeight += thickness[i] / 2;
				this.graphics.lineStyle(thickness[i], colors[i], alphas[i], true, "normal", CapsStyle.SQUARE);
				graphics.moveTo(thickness[i] / 2, drawedHeight);
				graphics.lineTo(width - thickness[i] / 2, drawedHeight);
				drawedHeight += thickness[i] / 2;
				
			}
		}
	}
}